package com.lin.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lin.gulimall.common.to.SkuHasStockVo;
import com.lin.gulimall.common.to.mq.StockLockedTo;
import com.lin.gulimall.common.to.order.OrderTO;
import com.lin.gulimall.common.utils.PageUtils;
import com.lin.gulimall.common.utils.R;
import com.lin.gulimall.ware.entity.WareSkuEntity;
import com.lin.gulimall.ware.to.WareSkuLockTO;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author xiaolin
 * @email 3088386588@qq.com
 * @date 2022-05-08 11:50:34
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<SkuHasStockVo> getSkuHasStock(List<Long> skuIds);

    boolean orderLockStock(WareSkuLockTO lockTO);

    void unLockStock(StockLockedTo locked) throws Exception;

    void unLockStock(OrderTO orderTo) throws Exception;
}

